package spindles.api.domain;

import java.util.Date;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.sleepycat.persist.model.Persistent;

@Persistent
public class VDSpindle extends Spindle{	
	
	/**
	 * 
	 */
	private static transient final long serialVersionUID = -1038792795309495506L;
	private long userID;
	
	public VDSpindle(User user) {
		super();
		userID = user.getId();
	}
	
	public VDSpindle(User user, Date from, Date to){
		super(from, to);
		this.userID = user.getId();
	}
	
	private VDSpindle(){};
	
	public long getUserID(){
		return userID;
	}
	
	public int compareTo(Object o) {
		return CompareToBuilder.reflectionCompare(this, o);
	}
	
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}
	
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(17, 
				37, this);
	}
	

}
